//
//
//  @ Project : AgriMarketSystem
//  @ Date : 18/10/2013
//  @ Author : NTT
//
//
using System.Collections.Generic;
using System.Linq;
namespace AgriMarketService
{
    public class TypeOfUser
    {
        private int typeId;

        public int TypeId
        {
            get { return typeId; }
            set { typeId = value; }
        }
        private string typeName;

        public string TypeName
        {
            get { return typeName; }
            set { typeName = value; }
        }
        public static List<TypeOfUser> GetAllTypes()
        {
            return new List<TypeOfUser>() {
                new TypeOfUser(){TypeId=1,TypeName="User 1"},
                new TypeOfUser(){TypeId=2,TypeName="User 2"},
                new TypeOfUser(){TypeId=3,TypeName="User 3"},
                new TypeOfUser(){TypeId=4,TypeName="User 4"},
                new TypeOfUser(){TypeId=5,TypeName="User 5"}
            };
        }
        public static TypeOfUser GetTypeById(int typeId)
        {
            List<TypeOfUser> allTypes = GetAllTypes();
            TypeOfUser type = (from tempType in allTypes where tempType.TypeId == typeId select tempType).FirstOrDefault();
            return type;
        }
    }
}